//
//  PreCollectionViewCell.m
//  ATMCash
//
//  Created by zhengchengfeng on 2024/9/11.
//

#import "PreCollectionViewCell.h"

@implementation PreCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
       
        self.backgroundColor = [UIColor clearColor];
       
        self.imgView = [[UIImageView alloc]init];
        [self addSubview:self.imgView];
        [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(15);
            make.top.equalTo(self.contentView.mas_top).offset(10);
            make.width.with.height.equalTo(@(DimensionBaseIphone6(120)));
        }];
        
        self.titleLab = [Utility createLabel:[UIFont fontWithName:kFuturaMedium size:13] color:[UIColor colorWithHexString:@"#FFEFC0"]];
        self.titleLab.textAlignment = 1;
        [self addSubview:self.titleLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.imgView.mas_left);
            make.right.equalTo(self.imgView.mas_right);
            make.top.equalTo(self.imgView.mas_bottom).offset(10);
            make.height.equalTo(@20);
        }];
        self.titleLab.adjustsFontSizeToFitWidth = YES;
        
        
    }
    return self;
}

- (void)setModel:(BonedModel *)model{
    _model = model;
    
    self.titleLab.text = esString(model.ego);
    
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:esString(model.overgrown)]];
    
    self.imgView.contentMode = UIViewContentModeScaleAspectFit;
    
//    self.imgView.backgroundColor = kArcRandomColor;
    
    if ([model.teetotallers integerValue] == 1) {//  
        
    } else {
        
    }
    
    
}
@end

